package com.matrix.java.chap_05;
/*
    打印2到1000之间的素数
 */
public class Ex5_20 {
    public static void main(String[] args) {

        int count = 1;
        for (int i = 2; i < 10000; i++) {
            boolean isPrime =true;
            for (int j = 2; j < i; j++) {
                if (i%j==0){
                    isPrime =false;
                    break;
                }
            }
            if (isPrime){
                if (count % 8 != 0) {
                    System.out.print(i+" ");
                }else {
                    System.out.println(i);
                }
                count++;
            }
        }
    }
}
